<?php

class Model_Dbtable_Wowmenusub extends Zend_Db_Table_Abstract
{
    /**
     * The default table name 
     */
    protected $_name = 'db_wow_menu_sub';
    
	//SUBCLASS 菜单
	public function showsub($classid){
		$table = $this->getAdapter();
		$where = $table->quoteInto("class_id = ?", "$classid");
		
		$query = $table->query("SELECT * FROM $this->_name WHERE $where ORDER BY id ");
		
		return $query;
	}
	
	public function subname($class, $sub){
		if (($class != "-1") && ($sub != "-1")){
			$subname = $this->fetchRow("class_id = '$class' AND sub_id = '$sub'");
			return $subname;
		}
	}
	
	public function subnav($class){
		if ($class != "-1") {
			$subnav = $this->fetchAll("class_id = '$class'")->toArray();
			return $subnav;
		}
	}
}
